<template>
  <div id="app">
    <el-menu
      :router="true"
      mode="horizontal"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <el-menu-item index="/design">设计器</el-menu-item>
      <el-menu-item index="/preview">预览</el-menu-item>
      <el-menu-item index="/formViewer">查看表单</el-menu-item>
    </el-menu>
    
    <router-view />
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

// 示例：保存表单时跳转到预览页
const saveForm = (formJson: string) => {
  router.push({
    path: '/preview',
    query: { data: formJson }
  })
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}

.el-menu {
  margin-bottom: 20px;
}
</style>